package com.sunshine.effctive.chapter02.item3;

/**
 * @author WeiHong
 * @date 2019/11/21 10:11
 */
public class TestApp {

    public static void main(String[] args) {
        //使用私有构造方式实现单例模式
        SingleObject instance = SingleObject.getInstance();
        instance.showMessage();
        //使用枚举方式实现单例模式
        Elvis elvis = Elvis.INSTANCE;
        elvis.leaveTheBuilding();
    }
}
